import { View, Image } from '@tarojs/components';
import Taro from '@tarojs/taro';
import callPhoneIcon from '@/assets/images/order/call_phone.png';
import './index.scss';

export default function ({ text, phone }) {
  const callPhone = () => {
    Taro.makePhoneCall({
      phoneNumber: phone,
    });
  };
  return (
    <View className="call-phone section-block" onClick={callPhone}>
      <Image src={callPhoneIcon} />
      {text}
    </View>
  );
}
